package indi.zhifa.recipe.bailan.busy.controller.api;

import indi.zhifa.recipe.bailan.busy.appproperty.AppProperty;
import indi.zhifa.recipe.bailan.framework.common.entity.annotations.ZfRestController;
import indi.zhifa.recipe.bailan.framework.common.entity.dto.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "1.Nacos接口")
@RequestMapping("/api/nacos")
@Slf4j
@ZfRestController
@RequiredArgsConstructor
public class NacosPropertyApi {
    private final AppProperty mAppProperty;

    @Operation(summary = "获取颜色")
    @GetMapping("/color")
    public RestResponse<String> getColor(){
        return RestResponse.ok(mAppProperty.getColor());
    }
    @GetMapping("/energy")
    public int getEnergy(){
        return mAppProperty.getEnergy();
    }
}
